########## MACROS ###########################################################################
#############################################################################################

function(conan_message MESSAGE_OUTPUT)
    if(NOT CONAN_CMAKE_SILENT_OUTPUT)
        message(${ARGV${0}})
    endif()
endfunction()


macro(conan_find_apple_frameworks FRAMEWORKS_FOUND FRAMEWORKS FRAMEWORKS_DIRS)
    if(APPLE)
        foreach(_FRAMEWORK ${FRAMEWORKS})
            # https://cmake.org/pipermail/cmake-developers/2017-August/030199.html
            find_library(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND NAMES ${_FRAMEWORK} PATHS ${FRAMEWORKS_DIRS} CMAKE_FIND_ROOT_PATH_BOTH)
            if(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND)
                list(APPEND ${FRAMEWORKS_FOUND} ${CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND})
            else()
                message(FATAL_ERROR "Framework library ${_FRAMEWORK} not found in paths: ${FRAMEWORKS_DIRS}")
            endif()
        endforeach()
    endif()
endmacro()


function(conan_package_library_targets libraries package_libdir deps out_libraries out_libraries_target build_type package_name)
    unset(_CONAN_ACTUAL_TARGETS CACHE)
    unset(_CONAN_FOUND_SYSTEM_LIBS CACHE)
    foreach(_LIBRARY_NAME ${libraries})
        find_library(CONAN_FOUND_LIBRARY NAMES ${_LIBRARY_NAME} PATHS ${package_libdir}
                     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
        if(CONAN_FOUND_LIBRARY)
            conan_message(STATUS "Library ${_LIBRARY_NAME} found ${CONAN_FOUND_LIBRARY}")
            list(APPEND _out_libraries ${CONAN_FOUND_LIBRARY})
            if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
                # Create a micro-target for each lib/a found
                string(REGEX REPLACE "[^A-Za-z0-9.+_-]" "_" _LIBRARY_NAME ${_LIBRARY_NAME})
                set(_LIB_NAME CONAN_LIB::${package_name}_${_LIBRARY_NAME}${build_type})
                if(NOT TARGET ${_LIB_NAME})
                    # Create a micro-target for each lib/a found
                    add_library(${_LIB_NAME} UNKNOWN IMPORTED)
                    set_target_properties(${_LIB_NAME} PROPERTIES IMPORTED_LOCATION ${CONAN_FOUND_LIBRARY})
                    set(_CONAN_ACTUAL_TARGETS ${_CONAN_ACTUAL_TARGETS} ${_LIB_NAME})
                else()
                    conan_message(STATUS "Skipping already existing target: ${_LIB_NAME}")
                endif()
                list(APPEND _out_libraries_target ${_LIB_NAME})
            endif()
            conan_message(STATUS "Found: ${CONAN_FOUND_LIBRARY}")
        else()
            conan_message(STATUS "Library ${_LIBRARY_NAME} not found in package, might be system one")
            list(APPEND _out_libraries_target ${_LIBRARY_NAME})
            list(APPEND _out_libraries ${_LIBRARY_NAME})
            set(_CONAN_FOUND_SYSTEM_LIBS "${_CONAN_FOUND_SYSTEM_LIBS};${_LIBRARY_NAME}")
        endif()
        unset(CONAN_FOUND_LIBRARY CACHE)
    endforeach()

    if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
        # Add all dependencies to all targets
        string(REPLACE " " ";" deps_list "${deps}")
        foreach(_CONAN_ACTUAL_TARGET ${_CONAN_ACTUAL_TARGETS})
            set_property(TARGET ${_CONAN_ACTUAL_TARGET} PROPERTY INTERFACE_LINK_LIBRARIES "${_CONAN_FOUND_SYSTEM_LIBS};${deps_list}")
        endforeach()
    endif()

    set(${out_libraries} ${_out_libraries} PARENT_SCOPE)
    set(${out_libraries_target} ${_out_libraries_target} PARENT_SCOPE)
endfunction()


########### FOUND PACKAGE ###################################################################
#############################################################################################

include(FindPackageHandleStandardArgs)

conan_message(STATUS "Conan: Using autogenerated Findfolly.cmake")
set(folly_FOUND 1)
set(folly_VERSION "2023.10.30.08")

find_package_handle_standard_args(folly REQUIRED_VARS
                                  folly_VERSION VERSION_VAR folly_VERSION)
mark_as_advanced(folly_FOUND folly_VERSION)

set(Folly_COMPONENTS Folly::follybenchmark Folly::folly_test_util Folly::folly_exception_counter Folly::folly_exception_tracer Folly::folly_exception_tracer_base Folly::folly)

if(folly_FIND_COMPONENTS)
    foreach(_FIND_COMPONENT ${folly_FIND_COMPONENTS})
        list(FIND Folly_COMPONENTS "Folly::${_FIND_COMPONENT}" _index)
        if(${_index} EQUAL -1)
            conan_message(FATAL_ERROR "Conan: Component '${_FIND_COMPONENT}' NOT found in package 'Folly'")
        else()
            conan_message(STATUS "Conan: Component '${_FIND_COMPONENT}' found in package 'Folly'")
        endif()
    endforeach()
endif()

########### VARIABLES #######################################################################
#############################################################################################


set(Folly_INCLUDE_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_INCLUDE_DIR "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_INCLUDES "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_RES_DIRS )
set(Folly_DEFINITIONS "-DFOLLY_HAVE_ELF"
			"-DFOLLY_HAVE_DWARF")
set(Folly_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)
set(Folly_COMPILE_DEFINITIONS "FOLLY_HAVE_ELF"
			"FOLLY_HAVE_DWARF")
set(Folly_COMPILE_OPTIONS_LIST "" "")
set(Folly_COMPILE_OPTIONS_C "")
set(Folly_COMPILE_OPTIONS_CXX "")
set(Folly_LIBRARIES_TARGETS "") # Will be filled later, if CMake 3
set(Folly_LIBRARIES "") # Will be filled later
set(Folly_LIBS "") # Same as Folly_LIBRARIES
set(Folly_SYSTEM_LIBS pthread dl rt)
set(Folly_FRAMEWORK_DIRS )
set(Folly_FRAMEWORKS )
set(Folly_FRAMEWORKS_FOUND "") # Will be filled later
set(Folly_BUILD_MODULES_PATHS )

conan_find_apple_frameworks(Folly_FRAMEWORKS_FOUND "${Folly_FRAMEWORKS}" "${Folly_FRAMEWORK_DIRS}")

mark_as_advanced(Folly_INCLUDE_DIRS
                 Folly_INCLUDE_DIR
                 Folly_INCLUDES
                 Folly_DEFINITIONS
                 Folly_LINKER_FLAGS_LIST
                 Folly_COMPILE_DEFINITIONS
                 Folly_COMPILE_OPTIONS_LIST
                 Folly_LIBRARIES
                 Folly_LIBS
                 Folly_LIBRARIES_TARGETS)

# Find the real .lib/.a and add them to Folly_LIBS and Folly_LIBRARY_LIST
set(Folly_LIBRARY_LIST follybenchmark folly_test_util folly_exception_counter folly_exception_tracer folly_exception_tracer_base folly)
set(Folly_LIB_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/lib")

# Gather all the libraries that should be linked to the targets (do not touch existing variables):
set(_Folly_DEPENDENCIES "${Folly_FRAMEWORKS_FOUND} ${Folly_SYSTEM_LIBS} Boost::context;Boost::filesystem;Boost::program_options;Boost::regex;Boost::system;Boost::thread;BZip2::BZip2;double-conversion::double-conversion;gflags::gflags;glog::glog;libevent::libevent;lz4::lz4;OpenSSL::OpenSSL;Snappy::Snappy;ZLIB::ZLIB;zstd::zstd;libsodium::libsodium;LibLZMA::LibLZMA;libdwarf::libdwarf;libiberty::libiberty;libunwind::libunwind")

conan_package_library_targets("${Folly_LIBRARY_LIST}"  # libraries
                              "${Folly_LIB_DIRS}"      # package_libdir
                              "${_Folly_DEPENDENCIES}"  # deps
                              Folly_LIBRARIES            # out_libraries
                              Folly_LIBRARIES_TARGETS    # out_libraries_targets
                              ""                          # build_type
                              "Folly")                                      # package_name

set(Folly_LIBS ${Folly_LIBRARIES})

foreach(_FRAMEWORK ${Folly_FRAMEWORKS_FOUND})
    list(APPEND Folly_LIBRARIES_TARGETS ${_FRAMEWORK})
    list(APPEND Folly_LIBRARIES ${_FRAMEWORK})
endforeach()

foreach(_SYSTEM_LIB ${Folly_SYSTEM_LIBS})
    list(APPEND Folly_LIBRARIES_TARGETS ${_SYSTEM_LIB})
    list(APPEND Folly_LIBRARIES ${_SYSTEM_LIB})
endforeach()

# We need to add our requirements too
set(Folly_LIBRARIES_TARGETS "${Folly_LIBRARIES_TARGETS};Boost::context;Boost::filesystem;Boost::program_options;Boost::regex;Boost::system;Boost::thread;BZip2::BZip2;double-conversion::double-conversion;gflags::gflags;glog::glog;libevent::libevent;lz4::lz4;OpenSSL::OpenSSL;Snappy::Snappy;ZLIB::ZLIB;zstd::zstd;libsodium::libsodium;LibLZMA::LibLZMA;libdwarf::libdwarf;libiberty::libiberty;libunwind::libunwind")
set(Folly_LIBRARIES "${Folly_LIBRARIES};Boost::context;Boost::filesystem;Boost::program_options;Boost::regex;Boost::system;Boost::thread;BZip2::BZip2;double-conversion::double-conversion;gflags::gflags;glog::glog;libevent::libevent;lz4::lz4;OpenSSL::OpenSSL;Snappy::Snappy;ZLIB::ZLIB;zstd::zstd;libsodium::libsodium;LibLZMA::LibLZMA;libdwarf::libdwarf;libiberty::libiberty;libunwind::libunwind")

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})


########### COMPONENT folly VARIABLES #############################################

set(Folly_folly_INCLUDE_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_INCLUDE_DIR "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_INCLUDES "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_LIB_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/lib")
set(Folly_folly_RES_DIRS )
set(Folly_folly_DEFINITIONS "-DFOLLY_HAVE_ELF"
			"-DFOLLY_HAVE_DWARF")
set(Folly_folly_COMPILE_DEFINITIONS "FOLLY_HAVE_ELF"
			"FOLLY_HAVE_DWARF")
set(Folly_folly_COMPILE_OPTIONS_C "")
set(Folly_folly_COMPILE_OPTIONS_CXX "")
set(Folly_folly_LIBS folly_exception_counter folly_exception_tracer folly_exception_tracer_base folly_test_util follybenchmark folly)
set(Folly_folly_SYSTEM_LIBS pthread dl rt)
set(Folly_folly_FRAMEWORK_DIRS )
set(Folly_folly_FRAMEWORKS )
set(Folly_folly_BUILD_MODULES_PATHS )
set(Folly_folly_DEPENDENCIES Boost::context Boost::filesystem Boost::program_options Boost::regex Boost::system Boost::thread BZip2::BZip2 double-conversion::double-conversion gflags::gflags glog::glog libevent::libevent lz4::lz4 OpenSSL::OpenSSL Snappy::Snappy ZLIB::ZLIB zstd::zstd libsodium::libsodium LibLZMA::LibLZMA libdwarf::libdwarf libiberty::libiberty libunwind::libunwind)
set(Folly_folly_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT folly_exception_tracer_base VARIABLES #############################################

set(Folly_folly_exception_tracer_base_INCLUDE_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_tracer_base_INCLUDE_DIR "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_tracer_base_INCLUDES "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_tracer_base_LIB_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/lib")
set(Folly_folly_exception_tracer_base_RES_DIRS )
set(Folly_folly_exception_tracer_base_DEFINITIONS )
set(Folly_folly_exception_tracer_base_COMPILE_DEFINITIONS )
set(Folly_folly_exception_tracer_base_COMPILE_OPTIONS_C "")
set(Folly_folly_exception_tracer_base_COMPILE_OPTIONS_CXX "")
set(Folly_folly_exception_tracer_base_LIBS folly_exception_tracer_base)
set(Folly_folly_exception_tracer_base_SYSTEM_LIBS )
set(Folly_folly_exception_tracer_base_FRAMEWORK_DIRS )
set(Folly_folly_exception_tracer_base_FRAMEWORKS )
set(Folly_folly_exception_tracer_base_BUILD_MODULES_PATHS )
set(Folly_folly_exception_tracer_base_DEPENDENCIES Folly::folly)
set(Folly_folly_exception_tracer_base_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT folly_exception_tracer VARIABLES #############################################

set(Folly_folly_exception_tracer_INCLUDE_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_tracer_INCLUDE_DIR "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_tracer_INCLUDES "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_tracer_LIB_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/lib")
set(Folly_folly_exception_tracer_RES_DIRS )
set(Folly_folly_exception_tracer_DEFINITIONS )
set(Folly_folly_exception_tracer_COMPILE_DEFINITIONS )
set(Folly_folly_exception_tracer_COMPILE_OPTIONS_C "")
set(Folly_folly_exception_tracer_COMPILE_OPTIONS_CXX "")
set(Folly_folly_exception_tracer_LIBS folly_exception_tracer)
set(Folly_folly_exception_tracer_SYSTEM_LIBS )
set(Folly_folly_exception_tracer_FRAMEWORK_DIRS )
set(Folly_folly_exception_tracer_FRAMEWORKS )
set(Folly_folly_exception_tracer_BUILD_MODULES_PATHS )
set(Folly_folly_exception_tracer_DEPENDENCIES Folly::folly_exception_tracer_base)
set(Folly_folly_exception_tracer_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT folly_exception_counter VARIABLES #############################################

set(Folly_folly_exception_counter_INCLUDE_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_counter_INCLUDE_DIR "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_counter_INCLUDES "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_exception_counter_LIB_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/lib")
set(Folly_folly_exception_counter_RES_DIRS )
set(Folly_folly_exception_counter_DEFINITIONS )
set(Folly_folly_exception_counter_COMPILE_DEFINITIONS )
set(Folly_folly_exception_counter_COMPILE_OPTIONS_C "")
set(Folly_folly_exception_counter_COMPILE_OPTIONS_CXX "")
set(Folly_folly_exception_counter_LIBS folly_exception_counter)
set(Folly_folly_exception_counter_SYSTEM_LIBS )
set(Folly_folly_exception_counter_FRAMEWORK_DIRS )
set(Folly_folly_exception_counter_FRAMEWORKS )
set(Folly_folly_exception_counter_BUILD_MODULES_PATHS )
set(Folly_folly_exception_counter_DEPENDENCIES Folly::folly_exception_tracer)
set(Folly_folly_exception_counter_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT folly_test_util VARIABLES #############################################

set(Folly_folly_test_util_INCLUDE_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_test_util_INCLUDE_DIR "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_test_util_INCLUDES "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_folly_test_util_LIB_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/lib")
set(Folly_folly_test_util_RES_DIRS )
set(Folly_folly_test_util_DEFINITIONS )
set(Folly_folly_test_util_COMPILE_DEFINITIONS )
set(Folly_folly_test_util_COMPILE_OPTIONS_C "")
set(Folly_folly_test_util_COMPILE_OPTIONS_CXX "")
set(Folly_folly_test_util_LIBS folly_test_util)
set(Folly_folly_test_util_SYSTEM_LIBS )
set(Folly_folly_test_util_FRAMEWORK_DIRS )
set(Folly_folly_test_util_FRAMEWORKS )
set(Folly_folly_test_util_BUILD_MODULES_PATHS )
set(Folly_folly_test_util_DEPENDENCIES Folly::folly)
set(Folly_folly_test_util_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT follybenchmark VARIABLES #############################################

set(Folly_follybenchmark_INCLUDE_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_follybenchmark_INCLUDE_DIR "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_follybenchmark_INCLUDES "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/include")
set(Folly_follybenchmark_LIB_DIRS "/root/.conan/data/folly/2023.10.30.08/milvus/dev/package/4bf676c55e2f930646a6fa854ba8143f2f201580/lib")
set(Folly_follybenchmark_RES_DIRS )
set(Folly_follybenchmark_DEFINITIONS )
set(Folly_follybenchmark_COMPILE_DEFINITIONS )
set(Folly_follybenchmark_COMPILE_OPTIONS_C "")
set(Folly_follybenchmark_COMPILE_OPTIONS_CXX "")
set(Folly_follybenchmark_LIBS follybenchmark)
set(Folly_follybenchmark_SYSTEM_LIBS )
set(Folly_follybenchmark_FRAMEWORK_DIRS )
set(Folly_follybenchmark_FRAMEWORKS )
set(Folly_follybenchmark_BUILD_MODULES_PATHS )
set(Folly_follybenchmark_DEPENDENCIES Folly::folly)
set(Folly_follybenchmark_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)


########## FIND PACKAGE DEPENDENCY ##########################################################
#############################################################################################

include(CMakeFindDependencyMacro)

if(NOT Boost_FOUND)
    find_dependency(Boost REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency Boost already found")
endif()

if(NOT Boost_FOUND)
    find_dependency(Boost REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency Boost already found")
endif()

if(NOT Boost_FOUND)
    find_dependency(Boost REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency Boost already found")
endif()

if(NOT Boost_FOUND)
    find_dependency(Boost REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency Boost already found")
endif()

if(NOT Boost_FOUND)
    find_dependency(Boost REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency Boost already found")
endif()

if(NOT Boost_FOUND)
    find_dependency(Boost REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency Boost already found")
endif()

if(NOT BZip2_FOUND)
    find_dependency(BZip2 REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency BZip2 already found")
endif()

if(NOT double-conversion_FOUND)
    find_dependency(double-conversion REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency double-conversion already found")
endif()

if(NOT gflags_FOUND)
    find_dependency(gflags REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency gflags already found")
endif()

if(NOT glog_FOUND)
    find_dependency(glog REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency glog already found")
endif()

if(NOT Libevent_FOUND)
    find_dependency(Libevent REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency Libevent already found")
endif()

if(NOT lz4_FOUND)
    find_dependency(lz4 REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency lz4 already found")
endif()

if(NOT OpenSSL_FOUND)
    find_dependency(OpenSSL REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency OpenSSL already found")
endif()

if(NOT Snappy_FOUND)
    find_dependency(Snappy REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency Snappy already found")
endif()

if(NOT ZLIB_FOUND)
    find_dependency(ZLIB REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency ZLIB already found")
endif()

if(NOT zstd_FOUND)
    find_dependency(zstd REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency zstd already found")
endif()

if(NOT libsodium_FOUND)
    find_dependency(libsodium REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency libsodium already found")
endif()

if(NOT LibLZMA_FOUND)
    find_dependency(LibLZMA REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency LibLZMA already found")
endif()

if(NOT libdwarf_FOUND)
    find_dependency(libdwarf REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency libdwarf already found")
endif()

if(NOT libiberty_FOUND)
    find_dependency(libiberty REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency libiberty already found")
endif()

if(NOT libunwind_FOUND)
    find_dependency(libunwind REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency libunwind already found")
endif()


########## FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #######################################
#############################################################################################

########## COMPONENT folly FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(Folly_folly_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(Folly_folly_FRAMEWORKS_FOUND "${Folly_folly_FRAMEWORKS}" "${Folly_folly_FRAMEWORK_DIRS}")

set(Folly_folly_LIB_TARGETS "")
set(Folly_folly_NOT_USED "")
set(Folly_folly_LIBS_FRAMEWORKS_DEPS ${Folly_folly_FRAMEWORKS_FOUND} ${Folly_folly_SYSTEM_LIBS} ${Folly_folly_DEPENDENCIES})
conan_package_library_targets("${Folly_folly_LIBS}"
                              "${Folly_folly_LIB_DIRS}"
                              "${Folly_folly_LIBS_FRAMEWORKS_DEPS}"
                              Folly_folly_NOT_USED
                              Folly_folly_LIB_TARGETS
                              ""
                              "Folly_folly")

set(Folly_folly_LINK_LIBS ${Folly_folly_LIB_TARGETS} ${Folly_folly_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT folly_exception_tracer_base FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(Folly_folly_exception_tracer_base_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(Folly_folly_exception_tracer_base_FRAMEWORKS_FOUND "${Folly_folly_exception_tracer_base_FRAMEWORKS}" "${Folly_folly_exception_tracer_base_FRAMEWORK_DIRS}")

set(Folly_folly_exception_tracer_base_LIB_TARGETS "")
set(Folly_folly_exception_tracer_base_NOT_USED "")
set(Folly_folly_exception_tracer_base_LIBS_FRAMEWORKS_DEPS ${Folly_folly_exception_tracer_base_FRAMEWORKS_FOUND} ${Folly_folly_exception_tracer_base_SYSTEM_LIBS} ${Folly_folly_exception_tracer_base_DEPENDENCIES})
conan_package_library_targets("${Folly_folly_exception_tracer_base_LIBS}"
                              "${Folly_folly_exception_tracer_base_LIB_DIRS}"
                              "${Folly_folly_exception_tracer_base_LIBS_FRAMEWORKS_DEPS}"
                              Folly_folly_exception_tracer_base_NOT_USED
                              Folly_folly_exception_tracer_base_LIB_TARGETS
                              ""
                              "Folly_folly_exception_tracer_base")

set(Folly_folly_exception_tracer_base_LINK_LIBS ${Folly_folly_exception_tracer_base_LIB_TARGETS} ${Folly_folly_exception_tracer_base_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT folly_exception_tracer FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(Folly_folly_exception_tracer_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(Folly_folly_exception_tracer_FRAMEWORKS_FOUND "${Folly_folly_exception_tracer_FRAMEWORKS}" "${Folly_folly_exception_tracer_FRAMEWORK_DIRS}")

set(Folly_folly_exception_tracer_LIB_TARGETS "")
set(Folly_folly_exception_tracer_NOT_USED "")
set(Folly_folly_exception_tracer_LIBS_FRAMEWORKS_DEPS ${Folly_folly_exception_tracer_FRAMEWORKS_FOUND} ${Folly_folly_exception_tracer_SYSTEM_LIBS} ${Folly_folly_exception_tracer_DEPENDENCIES})
conan_package_library_targets("${Folly_folly_exception_tracer_LIBS}"
                              "${Folly_folly_exception_tracer_LIB_DIRS}"
                              "${Folly_folly_exception_tracer_LIBS_FRAMEWORKS_DEPS}"
                              Folly_folly_exception_tracer_NOT_USED
                              Folly_folly_exception_tracer_LIB_TARGETS
                              ""
                              "Folly_folly_exception_tracer")

set(Folly_folly_exception_tracer_LINK_LIBS ${Folly_folly_exception_tracer_LIB_TARGETS} ${Folly_folly_exception_tracer_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT folly_exception_counter FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(Folly_folly_exception_counter_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(Folly_folly_exception_counter_FRAMEWORKS_FOUND "${Folly_folly_exception_counter_FRAMEWORKS}" "${Folly_folly_exception_counter_FRAMEWORK_DIRS}")

set(Folly_folly_exception_counter_LIB_TARGETS "")
set(Folly_folly_exception_counter_NOT_USED "")
set(Folly_folly_exception_counter_LIBS_FRAMEWORKS_DEPS ${Folly_folly_exception_counter_FRAMEWORKS_FOUND} ${Folly_folly_exception_counter_SYSTEM_LIBS} ${Folly_folly_exception_counter_DEPENDENCIES})
conan_package_library_targets("${Folly_folly_exception_counter_LIBS}"
                              "${Folly_folly_exception_counter_LIB_DIRS}"
                              "${Folly_folly_exception_counter_LIBS_FRAMEWORKS_DEPS}"
                              Folly_folly_exception_counter_NOT_USED
                              Folly_folly_exception_counter_LIB_TARGETS
                              ""
                              "Folly_folly_exception_counter")

set(Folly_folly_exception_counter_LINK_LIBS ${Folly_folly_exception_counter_LIB_TARGETS} ${Folly_folly_exception_counter_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT folly_test_util FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(Folly_folly_test_util_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(Folly_folly_test_util_FRAMEWORKS_FOUND "${Folly_folly_test_util_FRAMEWORKS}" "${Folly_folly_test_util_FRAMEWORK_DIRS}")

set(Folly_folly_test_util_LIB_TARGETS "")
set(Folly_folly_test_util_NOT_USED "")
set(Folly_folly_test_util_LIBS_FRAMEWORKS_DEPS ${Folly_folly_test_util_FRAMEWORKS_FOUND} ${Folly_folly_test_util_SYSTEM_LIBS} ${Folly_folly_test_util_DEPENDENCIES})
conan_package_library_targets("${Folly_folly_test_util_LIBS}"
                              "${Folly_folly_test_util_LIB_DIRS}"
                              "${Folly_folly_test_util_LIBS_FRAMEWORKS_DEPS}"
                              Folly_folly_test_util_NOT_USED
                              Folly_folly_test_util_LIB_TARGETS
                              ""
                              "Folly_folly_test_util")

set(Folly_folly_test_util_LINK_LIBS ${Folly_folly_test_util_LIB_TARGETS} ${Folly_folly_test_util_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT follybenchmark FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(Folly_follybenchmark_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(Folly_follybenchmark_FRAMEWORKS_FOUND "${Folly_follybenchmark_FRAMEWORKS}" "${Folly_follybenchmark_FRAMEWORK_DIRS}")

set(Folly_follybenchmark_LIB_TARGETS "")
set(Folly_follybenchmark_NOT_USED "")
set(Folly_follybenchmark_LIBS_FRAMEWORKS_DEPS ${Folly_follybenchmark_FRAMEWORKS_FOUND} ${Folly_follybenchmark_SYSTEM_LIBS} ${Folly_follybenchmark_DEPENDENCIES})
conan_package_library_targets("${Folly_follybenchmark_LIBS}"
                              "${Folly_follybenchmark_LIB_DIRS}"
                              "${Folly_follybenchmark_LIBS_FRAMEWORKS_DEPS}"
                              Folly_follybenchmark_NOT_USED
                              Folly_follybenchmark_LIB_TARGETS
                              ""
                              "Folly_follybenchmark")

set(Folly_follybenchmark_LINK_LIBS ${Folly_follybenchmark_LIB_TARGETS} ${Folly_follybenchmark_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})


########## TARGETS ##########################################################################
#############################################################################################

########## COMPONENT folly TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET Folly::folly)
        add_library(Folly::folly INTERFACE IMPORTED)
        set_target_properties(Folly::folly PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${Folly_folly_INCLUDE_DIRS}")
        set_target_properties(Folly::folly PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${Folly_folly_LIB_DIRS}")
        set_target_properties(Folly::folly PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${Folly_folly_LINK_LIBS};${Folly_folly_LINKER_FLAGS_LIST}")
        set_target_properties(Folly::folly PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${Folly_folly_COMPILE_DEFINITIONS}")
        set_target_properties(Folly::folly PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${Folly_folly_COMPILE_OPTIONS_C};${Folly_folly_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT folly_exception_tracer_base TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET Folly::folly_exception_tracer_base)
        add_library(Folly::folly_exception_tracer_base INTERFACE IMPORTED)
        set_target_properties(Folly::folly_exception_tracer_base PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${Folly_folly_exception_tracer_base_INCLUDE_DIRS}")
        set_target_properties(Folly::folly_exception_tracer_base PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${Folly_folly_exception_tracer_base_LIB_DIRS}")
        set_target_properties(Folly::folly_exception_tracer_base PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${Folly_folly_exception_tracer_base_LINK_LIBS};${Folly_folly_exception_tracer_base_LINKER_FLAGS_LIST}")
        set_target_properties(Folly::folly_exception_tracer_base PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${Folly_folly_exception_tracer_base_COMPILE_DEFINITIONS}")
        set_target_properties(Folly::folly_exception_tracer_base PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${Folly_folly_exception_tracer_base_COMPILE_OPTIONS_C};${Folly_folly_exception_tracer_base_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT folly_exception_tracer TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET Folly::folly_exception_tracer)
        add_library(Folly::folly_exception_tracer INTERFACE IMPORTED)
        set_target_properties(Folly::folly_exception_tracer PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${Folly_folly_exception_tracer_INCLUDE_DIRS}")
        set_target_properties(Folly::folly_exception_tracer PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${Folly_folly_exception_tracer_LIB_DIRS}")
        set_target_properties(Folly::folly_exception_tracer PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${Folly_folly_exception_tracer_LINK_LIBS};${Folly_folly_exception_tracer_LINKER_FLAGS_LIST}")
        set_target_properties(Folly::folly_exception_tracer PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${Folly_folly_exception_tracer_COMPILE_DEFINITIONS}")
        set_target_properties(Folly::folly_exception_tracer PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${Folly_folly_exception_tracer_COMPILE_OPTIONS_C};${Folly_folly_exception_tracer_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT folly_exception_counter TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET Folly::folly_exception_counter)
        add_library(Folly::folly_exception_counter INTERFACE IMPORTED)
        set_target_properties(Folly::folly_exception_counter PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${Folly_folly_exception_counter_INCLUDE_DIRS}")
        set_target_properties(Folly::folly_exception_counter PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${Folly_folly_exception_counter_LIB_DIRS}")
        set_target_properties(Folly::folly_exception_counter PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${Folly_folly_exception_counter_LINK_LIBS};${Folly_folly_exception_counter_LINKER_FLAGS_LIST}")
        set_target_properties(Folly::folly_exception_counter PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${Folly_folly_exception_counter_COMPILE_DEFINITIONS}")
        set_target_properties(Folly::folly_exception_counter PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${Folly_folly_exception_counter_COMPILE_OPTIONS_C};${Folly_folly_exception_counter_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT folly_test_util TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET Folly::folly_test_util)
        add_library(Folly::folly_test_util INTERFACE IMPORTED)
        set_target_properties(Folly::folly_test_util PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${Folly_folly_test_util_INCLUDE_DIRS}")
        set_target_properties(Folly::folly_test_util PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${Folly_folly_test_util_LIB_DIRS}")
        set_target_properties(Folly::folly_test_util PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${Folly_folly_test_util_LINK_LIBS};${Folly_folly_test_util_LINKER_FLAGS_LIST}")
        set_target_properties(Folly::folly_test_util PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${Folly_folly_test_util_COMPILE_DEFINITIONS}")
        set_target_properties(Folly::folly_test_util PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${Folly_folly_test_util_COMPILE_OPTIONS_C};${Folly_folly_test_util_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT follybenchmark TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET Folly::follybenchmark)
        add_library(Folly::follybenchmark INTERFACE IMPORTED)
        set_target_properties(Folly::follybenchmark PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${Folly_follybenchmark_INCLUDE_DIRS}")
        set_target_properties(Folly::follybenchmark PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${Folly_follybenchmark_LIB_DIRS}")
        set_target_properties(Folly::follybenchmark PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${Folly_follybenchmark_LINK_LIBS};${Folly_follybenchmark_LINKER_FLAGS_LIST}")
        set_target_properties(Folly::follybenchmark PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${Folly_follybenchmark_COMPILE_DEFINITIONS}")
        set_target_properties(Folly::follybenchmark PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${Folly_follybenchmark_COMPILE_OPTIONS_C};${Folly_follybenchmark_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## GLOBAL TARGET ####################################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    if(NOT TARGET Folly::Folly)
        add_library(Folly::Folly INTERFACE IMPORTED)
    endif()
    set_property(TARGET Folly::Folly APPEND PROPERTY
                 INTERFACE_LINK_LIBRARIES "${Folly_COMPONENTS}")
endif()

########## BUILD MODULES ####################################################################
#############################################################################################
########## COMPONENT folly BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${Folly_folly_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT folly_exception_tracer_base BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${Folly_folly_exception_tracer_base_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT folly_exception_tracer BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${Folly_folly_exception_tracer_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT folly_exception_counter BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${Folly_folly_exception_counter_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT folly_test_util BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${Folly_folly_test_util_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT follybenchmark BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${Folly_follybenchmark_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
